package com.xlhj.mongodb.config;

import com.xlhj.mongodb.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Component;

/**
 * @ClassName MongoDbConfig
 * @Description TODO
 * @Author liucaijing
 * @Date 2021/2/26 15:14
 * @Version 1.0
 */
@Component
public class MongoDbConfig {

    @Autowired
    private MongoTemplate mongoTemplate;

    public SysUser insertMongo(SysUser user) {
        SysUser insertUser = mongoTemplate.insert(user);
        return insertUser;
    }
}
